import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Target {
    private final String name;
    
    private final List<String> dependencies = new ArrayList<>();
    private final List<String> commands = new ArrayList<>();
    private final List<String> compilerArgs = new ArrayList<>();
    private final Map<String, String> properties = new HashMap<>();
    
    private String directory;
    private String classpath;
    private String sourceDir;
    private String outputDir;

    public Target(String name) {
        this.name = name;
    }

    public void addDependency(String dependency) {
        if (dependency != null && !dependency.trim().isEmpty()) {
            dependencies.add(dependency.trim());
        }
    }

    public List<String> getDependencies() {
        return new ArrayList<>(dependencies);
    }

    public void addCommand(String command) {
        if (command != null && !command.trim().isEmpty()) {
            commands.add(command.trim());
        }
    }

    public List<String> getCommands() {
        return new ArrayList<>(commands);
    }

    public void addCompilerArg(String arg) {
        if (arg != null && !arg.trim().isEmpty()) {
            compilerArgs.add(arg.trim());
        }
    }

    public List<String> getCompilerArgs() {
        return new ArrayList<>(compilerArgs);
    }

    public void addProperty(String key, String value) {
        if (key != null && value != null) {
            properties.put(key.trim(), value.trim());
        }
    }

    public Map<String, String> getProperties() {
        return new HashMap<>(properties);
    }

    public String getDirectory() {
        return directory;
    }

    public void setDirectory(String directory) {
        this.directory = directory;
    }

    public String getClasspath() {
        return classpath;
    }

    public void setClasspath(String classpath) {
        this.classpath = classpath;
    }

    public String getSourceDir() {
        return sourceDir;
    }

    public void setSourceDir(String sourceDir) {
        this.sourceDir = sourceDir;
    }

    public String getOutputDir() {
        return outputDir;
    }

    public void setOutputDir(String outputDir) {
        this.outputDir = outputDir;
    }

    public String getName() {
        return name;
    }
}